package com.onec.service.manage.dto.resp;

import com.onec.service.api.dto.response.BaseResponse;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.shiro.authc.AuthenticationToken;

import java.util.Date;

/**
 * 用户token 值管理！
 * 验证时传递的token 值
 *
 * @author onec
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class UserToken extends BaseResponse implements AuthenticationToken {

    private String token;

    private Long userId;

    private Date updateTime;

    private Date expireTime;

    public UserToken(String token) {
        this.token = token;
    }

    @Override
    public Object getPrincipal() {
        return token;
    }

    @Override
    public Object getCredentials() {
        return token;
    }
}
